{{/*
    Docs: https://docs.hugoblox.com/content/writing-markdown-latex/#cite

    Parameters
    ----------
    page : required
        Path to Markdown page to be referenced.
    view : optional, default "compact"
        A built-in Hugo Blox Builder view or an installed community view.
*/}}

{{ $page := .Page }}
{{ $item := .Get "page" }}

{{/* Default compact view. */}}
{{ $view := (.Get "view") | default "compact" }}

{{/* Hugo stores all shortcode args as strings, however `render_view` expects legacy numeric views 1-4 to be int */}}
{{ $view = cond (in (slice "1" "2" "3" "4") $view) (int $view) $view }}

{{ with site.GetPage $item }}
  {{ partial "functions/render_view" (dict "page" $page "item" . "view" $view "index" 0) }}
{{ end }}
